import request from '@/utils/request'

// 查询消耗品material_info列表 (分页)
export function selectPageMaterialInfo(query) {
  return request({
    url: '/material/materialInfo/selectPage',
    method: 'get',
    params: query
  })
}

// 查询消耗品material_info列表 (不分页)
export function listMaterialInfo(query) {
  return request({
    url: '/material/materialInfo/list',
    method: 'get',
    params: query
  })
}

// 查询消耗品material_info详细
export function getMaterialInfo(materialInfoId) {
  return request({
    url: '/material/materialInfo/' + materialInfoId,
    method: 'get'
  })
}

// 新增消耗品material_info
export function addMaterialInfo(data) {
  return request({
    url: '/material/materialInfo',
    method: 'post',
    data: data
  })
}

// 修改消耗品material_info
export function updateMaterialInfo(data) {
  return request({
    url: '/material/materialInfo',
    method: 'put',
    data: data
  })
}

// 删除消耗品material_info
export function delMaterialInfo(materialInfoId) {
  return request({
    url: '/material/materialInfo/' + materialInfoId,
    method: 'delete'
  })
}

// 生成药品编码
export function getAutoMaterialCode(query) {
  return request({
      url: "/material/materialInfo/getAutoMaterialCode",
      method: "get",
      params: query,
  });
}
